#####################################################################
# File:         FilterListeners.py
# Product:      KnowledgeEngine
#
# Copyright:    Copyright (c) 2002, Faulkner Ltd.
# Author:       Brian Oliver
#
# Description:  This file defines the FilterListeners class to
#               manage a collection of registered MessageListeners
#               for a specified Filter and filter function.
#
# Note:         Topic, Filter and Group names are case-sensitive
#
# See Also:     Messaging, Message, MessageListener, TopicListeners,
#               GroupListeners
#####################################################################

#####################################################################
## KnowledgeEngine Library Imports
from TopicListeners import *

#####################################################################
## Zope Library Imports
# (none)
 
#####################################################################
## Python Library Imports
# (none)

#####################################################################
## FilterListeners Class Definition
class FilterListeners(TopicListeners):
    """
        A class to that stores the registered MessageListeners
        for a particular named Filter and function.
    """
        
    #---------------------------------------------------------------#
    
    #the filter function for this filter
    function = (lambda x: 0 == 0)    #always true!
    
    #---------------------------------------------------------------#

    def __init__(self, name, function):
        """
            Constructor for the Filter
        """
        
        TopicListeners.__init__(self, name)
        self.function = function
        
    #---------------------------------------------------------------#

    def getFunction(self):
        """
            Return the filter function
        """
        return self.function
        
    #---------------------------------------------------------------#

#####################################################################
## Class Initialisation
# (none)
